package com.edu.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Auther:zzp
 * @Date:2025/11/14-10:06:15
 */
@Aspect
@Component
public class MyAdvise {

    @Pointcut("execution(public * com.edu.service..*.*(..))")
    public void pt1(){}


    @Before("pt1()")
    public void a1(){
        System.out.println("执行了前置通知");
    }

    @AfterReturning(pointcut = "pt1()",returning = "re")
    public void a2(JoinPoint jt,Object re){
        System.out.println("执行了后置返回通知");
    }
}
